package cn.com.ejiakanghu.vo;

import org.linlinjava.litemall.db.domain.LitemallUser;
import org.linlinjava.litemall.db.util.DateUtil;

public class UserInfoVo {
    private Integer uid;
    private String phone;
    private String nickName;
    private String avatarUrl;
    private String source;
    private String created;
    private String roles;
    private Integer vipLevel;

    public static UserInfoVo getInstance(LitemallUser litemallUser, String roles) {
        UserInfoVo userInfoVo = new UserInfoVo();
        userInfoVo.setUid(litemallUser.getId());
        userInfoVo.setPhone(litemallUser.getMobile());
        userInfoVo.setNickName(litemallUser.getNickname());
        userInfoVo.setAvatarUrl(litemallUser.getAvatar());
        userInfoVo.setSource(litemallUser.getCreateSource());
        userInfoVo.setCreated(null == litemallUser.getAddTime() ? null : litemallUser.getAddTime().format(DateUtil.DATE_TIME_FORMATTER));
        userInfoVo.setRoles(roles);
        return userInfoVo;
    }

    public Integer getVipLevel() {
        return vipLevel;
    }

    public void setVipLevel(Integer vipLevel) {
        this.vipLevel = vipLevel;
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getAvatarUrl() {
        return avatarUrl;
    }

    public void setAvatarUrl(String avatarUrl) {
        this.avatarUrl = avatarUrl;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getCreated() {
        return created;
    }

    public void setCreated(String created) {
        this.created = created;
    }

    public String getRoles() {
        return roles;
    }

    public void setRoles(String roles) {
        this.roles = roles;
    }
}
